/**
 * 点餐路由
 * @description 点菜相关的路由配置
 */
import {NgModule} from '@angular/core';
import {RouteReuseStrategy, RouterModule, Routes} from '@angular/router';
import {IndexComponent} from './index/index.component';
import {IndexDataGuard} from './grauds/index-data.guard';
import {SearchComponent} from './search/search.component';
import {CustomerRouteReuseStrategy} from '../CustomerRouteReuseStrategy';


let mainRoutings: Routes = [
  {path: '', redirectTo: 'table', pathMatch: 'full'}
  , {path: 'index', component: IndexComponent, canActivate: [IndexDataGuard]} // 首页
  , {path: 'search', component: SearchComponent} // 搜索
  , {path: 'line-up', loadChildren: './line-up/lineUp.module#LineUpModule'} // 排队
  , {path: 'table', loadChildren: './table/table.module#TableModule'} // 桌台
  , {path: 'order', loadChildren: './order/order.module#OrderModule'} // 订单
  , {path: 'statistics', loadChildren: './statistics/statistics.module#StatisticsModule'} // 统计
  , {path: 'set', loadChildren: './set/set.module#SetModule'} // 个人设置
  , {path: 'ess', loadChildren: './ess/ess.module#EssModule'} // 进销存
  , {path: 'operation', loadChildren: './operation/operation.module#OperationModule'} // 操作台
];

@NgModule({
  imports: [RouterModule.forChild(mainRoutings)],
  exports: [RouterModule],
  providers: [
    // { provide: RouteReuseStrategy, useClass: CustomerRouteReuseStrategy }
  ]
})

export class MainRoutingModule {
}
